package com.atguigu.order.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

/**
 * 限流配置类
 * 对应配置前缀: rate.limit
 */
@Data
@Component
@ConfigurationProperties(prefix = "rate.limit")
@RefreshScope
public class RateLimitProperties {

    /**
     * 每秒请求数限制
     * 对应配置: rate.limit.qps
     */
    private Integer qps = 100;

    /**
     * 是否启用限流
     * 对应配置: rate.limit.enabled
     */
    private Boolean enabled = true;

}